package com.lzh.eventdemo.propertyChangeListener;

import java.util.ArrayList;
import java.util.List;

/**
 * @author by lzh
 * @Classname TestMain
 * @Description TODO
 * @Date 2024/12/13 16:17
 */
public class TestMain {

    public static void main(String[] args) {
        Person p = new Person(65);
        //添加监听器
        p.addPropertyChangeListener(new PersonPropertyListener());
        p.addPropertyChangeListener(new PersonPropertyListener2());
        test(p);
        List<Object> list = new ArrayList<>();
        list.add(new Person(50));
        list.add(new Person(60));
        Person[] array = list.toArray(new Person[0]);
        for (Person person : array) {
            System.out.println("person = " + person);
        }
    }

    static void test(Person person) {
        person.setWeight(66);
    }

}
